package Day07;

import java.util.Random;
import java.util.Scanner;

public class Guessing3 {
    public static void main(String[] args) {
        Scanner scn =new Scanner(System.in);
        Random ron=new Random();
        int num= (int)(Math.random()*1000);
        System.out.println(num);//作弊
        while (true){//创建一个死循环
            System.out.println("请输入数字");
            int guess= scn.nextInt();
            if (guess>num){
                System.out.println("猜大了");

            }else if(guess<num){
                System.out.println("猜小了");
            }else{
                System.out.println("恭喜你猜对了，游戏结束");
                break;//跳出循环
            }
        }


    }
}
